<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
    <title>
        Sample of Silverlight AJAX bridge
    </title>
    <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>-->
    <script src="../../js/jquery.js" type="text/javascript"></script>
    <script src="../../js/gestalt.js" type="text/javascript"></script>
    <script src="help.py" class="*" language="python"></script>
</head>
<body>
    <div id="text"></div>
    <xml id="WildHorses" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" class="xaml" width="800" height="600" style="display:none;">
        <StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="panel" Orientation="Vertical">
            <MediaElement x:Name="movie" Source="../samples/video/Wildlife.wmv" Width="800" Height="400"></MediaElement>
            <StackPanel x:Name="buttons" Orientation="Horizontal">
                <Button Content="Play" x:Name="play"></Button>
                <Button Content="Pause" x:Name="pause"></Button>
                <Button Content="Stop" x:Name="stop"></Button>
                <Button Content="Message" x:Name="message"></Button>
            </StackPanel>
        </StackPanel>
    </xml>
    <script language="ruby" class="WildHorses">
def play
    alert("called play")
    $me.movie.Play
end

def pause
    $me.movie.Pause
end  

def stop
    $me.movie.Stop
end

def showVideoMessage
    vb = VideoBrush.new()
    vb.SourceName = "movie"
    vb.Stretch = Stretch.UniformToFill
    
    message = TextBlock.new()
    message.Text = "EdgeCase!"
    message.FontSize = 100
    message.Foreground = vb
    
    $me.panel.Children.Add(message)
end

$me.play.Click += play
$me.pause.Click << pause
$me.stop.Click << stop
$me.message.Click += showVideoMessage
document.text.innerHTML = "movie demo"
    </script>
</body>
</html>